import {PoolVO} from "@/model/pool.js";

/**
 * SubmitVO
 * @type {{poolVO: {poolId: string, title: string, difficulty: string, description: string},
 * status: string, code: string, codeType: string, useMilTime: number, useKbMemory: number, errorTip: string, putTime: string}}
 */
export const SubmitVO = {
    submitId:'',
    poolVO: {...PoolVO},
    status: '',
    code: '',
    codeType: '',
    useMilTime: null,
    useKbMemory: null,
    errorMsg: '',
    putTime: '',
}

/**
 *
 * @type {{userId: string, poolId: string, code: string, codeType: string}}
 */
export const SubmitPutDTO = {
    userId: '', //后端为 Long
    poolId: '', //后端为 Long
    code: '',
    codeType: '',
}

export const CodeTypes = ['Java', 'JavaScript', 'C', 'Cpp'];

export const statusTagType = (status) => {
    return status === 'commited' ? 'primary' : status === 'compiling' ? 'warning' :
        status === 'succeeded' ? 'success' : status === 'failed' ? 'danger' : 'info';
}

export const statusTagText = (status) => {
    return status === 'commited' ? '已提交' : status === 'compiling' ? '编译中' :
        status === 'succeeded' ? '解题成功' : status === 'failed' ? '解题失败' : '未 知';
}


